import Vue from 'vue'
import Router from 'vue-router'

import App from '@/App'
import News from '@/pages/news/NewsList'
import Login from '@/pages/login/login'
import Register from '@/pages/register/register'
import NewsDetail from '@/pages/news/children/NewsDetail'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    component: App,
    children: [
      {
        path: '',
        redirect: '/news'
      },
      {
        path: '/login',
        component: Login,
      },
      {
        path: '/register',
        component: Register,
      },
      {
        path: '/news',
        component: News,
        children:[{
          name: 'newsDetail',
          path: 'newsDetail',
          component: NewsDetail,
        }]
      }
    ]
  }]
})
